package com.bootemp.mapper;

import com.bootemp.bean.Dept;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface DeptMapper {
    @Insert(value = "insert into dept values(default,#{dname},#{loc})")
    int insert(Dept d);
    @Select(value = "select * from dept")
    List<Dept> all();
    @Delete(value = "delete from dept where deptno=#{id}")
    int delete(int id);
    @Select(value = "select * from dept where deptno=#{id}")
    Dept one(int id);
    @Update(value = "update dept set dname=#{dname},loc=#{loc} where deptno=#{deptno}")
    int update(Dept d);
}
